import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 绘图信息 */
export interface Grafify {
          id: number; // 主键
          type: string; // 绘图类型
          content: string; // 数据内容
  }

// 绘图 API
export const GrafifyApi = {
  // 查询绘图分页
  getGrafifyPage: async (params: any) => {
    return await request.get({ url: `/medical/grafify/page`, params })
  },

  // 查询绘图详情
  getGrafify: async (id: number) => {
    return await request.get({ url: `/medical/grafify/get?id=` + id })
  },

  // 新增绘图
  createGrafify: async (data: Grafify) => {
    return await request.post({ url: `/medical/grafify/create`, data })
  },

  // 修改绘图
  updateGrafify: async (data: Grafify) => {
    return await request.put({ url: `/medical/grafify/update`, data })
  },

  // 删除绘图
  deleteGrafify: async (id: number) => {
    return await request.delete({ url: `/medical/grafify/delete?id=` + id })
  },

  /** 批量删除绘图 */
  deleteGrafifyList: async (ids: number[]) => {
    return await request.delete({ url: `/medical/grafify/delete-list?ids=${ids.join(',')}` })
  },

  // 导出绘图 Excel
  exportGrafify: async (params) => {
    return await request.download({ url: `/medical/grafify/export-excel`, params })
  },
}